package com.ftg.learn.day16.xmlbase.main;

import com.ftg.learn.day16.xmlbase.domain.CourseDomain;
import com.ftg.learn.day16.xmlbase.domain.TeacherDomain;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author 布衣
 */
public class TestBeans {


    public static void main(String[] args) {
        System.out.println("实例化池(容器)");
        BeanFactory beanFactory = new ClassPathXmlApplicationContext("spring/xmlbase.xml");
//
//        System.out.println("获取teacher实例");
//        TeacherDomain teacher = (TeacherDomain) beanFactory.getBean("teacher");
//        System.out.println(teacher.getTname());


        //GC

//        CourseDomain courseDomain = (CourseDomain) beanFactory.getBean("course");
//        System.out.println(courseDomain.getCname());
//        System.out.println(courseDomain.getTeacher().getTname());
    }

}
